// 导入封装好的axios
import axios from "../../http/axios"; // 导入http中创建的axios实例
import base from "../base"; // 导入接口域名列表
import { refresh } from "less";

const loginhome = {
  // 登录接口
  // loging(params = {}) {
  //   return axios.post(`${base.spurl}/ncpr/user/login`, params);
  // },
  loging(params = {}) {
    return axios.post(`${base.spurl}/ncpr/user/login`, params);
  },
  //上传
  upLoad(params = {}) {
    return axios.post(`${base.spurl}/ncpr/monitor/excelImport`, params);
  },
  //菜单列表
  menu(params = {}) {
    return axios.get(`${base.spurl}/ncpr/user/menu`, { params: params })
  },
  // 角色列表
  role(params = {}) {
    return axios.get(`${base.spurl}/ncpr/role/all`, { params: params })
  },
  //人员列表
  useList(params = {}) {
    return axios.post(`${base.spurl}/ncpr/user/page`, params)
  },
  //用户修改
  useUpdate(params = {}) {
    return axios.put(`${base.spurl}/ncpr/user/update`, params)
  },
  //用户新增
  useAdd(params = {}) {
    return axios.post(`${base.spurl}/ncpr/user/add`, params)
  },
  //用户删除
  useDel(params) {
    return axios.get(`${base.spurl}/ncpr/user/del/${params}`)
  },
  // 表格列表接口
  tablist(params = {}) {
    return axios.get(`${base.spurl}/ncpr/npro/findAllNcpr`, { params: params });
  },
  // 新增接口
  add(params) {
    return axios.post(`${base.spurl}/ncpr/npro/addNcpr`, params);
  },
  //模糊查询
  find(params = {}) {
    return axios.post(`${base.spurl}/ncpr/npro/page`, params)
  },
  //项目列表删除
  delPro(id){
    return axios.delete(`${base.spurl}/ncpr/npro/deleteNcprById/${id}`)
  },
  // 查看详情
  particulars(params = {}) {
    return axios.get(`${base.spurl}/ncpr/npro/findById`, { params: params })
  },
  //监控列表
  page(params = {}) {
    return axios.post(`${base.spurl}/ncpr/monitor/page`, params)
  },
  //监控修改
  update(params = {}) {
    return axios.post(`${base.spurl}/ncpr/monitor/update`, params)
  },
  //监控新增
  save(params = {}) {
    return axios.post(`${base.spurl}/ncpr/monitor/save`, params)
  },
  //监控删除
  deleteMonitor(params = {}) {
    return axios.get(`${base.spurl}/ncpr/monitor/delete`, { params: params })
  },
  //监控token
  tokenMonitor(params = {}) {
    return axios.get(`${base.spurl}/ncpr/monitor/token`, { params: params })
  },
  //照片查询
  pointpage(params = {}) {
    return axios.post(`${base.spurl}/ncpr/point/page`, params)
  },
  //增加点位
  addPoint(params = {}) {
    return axios.post(`${base.spurl}/ncpr/point/addPoint`, params)
  },
  //点位照片
  logAdd(params = {}) {
    return axios.post(`${base.spurl}/ncpr/point/log/save`, params)
  },
  //修改点位
  updatePoint(params = {}) {
    return axios.post(`${base.spurl}/ncpr/point/updatePoint`, params)
  },
  //点位删除
  deletePoint(params = {}) {
    return axios.get(`${base.spurl}/ncpr/point/delete`, { params: params })
  },
  //删除日志
  deleteLog(params = {}) {
    return axios.get(`${base.spurl}/ncpr/point/log/delete`, { params: params })
  },
  //日志列表
  logPage(params = {}) {
    return axios.post(`${base.spurl}/ncpr/point/log/page`, params)
  },
  //查询所有项目
  findAllNcpr(params = {}) {
    return axios.get(`${base.spurl}/ncpr/npro/findAllNcpr`, { params: params })
  },
  //航拍图查询
  airPage(params = {}) {
    return axios.post(`${base.spurl}/ncpr/air/count/page`, params)
  },
  //删除图
  del(params = {}) {
    return axios.get(`${base.spurl}/ncpr/air/log/del`, { params: params })
  },
  //新增照片
  addAir(params = {}) {
    return axios.post(`${base.spurl}/ncpr/air/log/save`, params)
  },
  //查询航拍图
  airList(params = {}) {
    return axios.post(`${base.spurl}/ncpr/air/log/list`, params)
  },
  // 获取 乐橙 token
  getLcToken(params = {}) {
    return axios.get(`${base.spurl}/ncpr/monitor/v2/token`, { params: params })
  },
  //接入统计
  getProCount(){
    return axios.get(`${base.spurl}/ncpr/npro/proCount`)
  },
  getMonitorCount(){
    return axios.get(`${base.spurl}/ncpr/monitor/monitorCount`)
  },
  getPointCount(){
    return axios.get(`${base.spurl}/ncpr/monitor/pointCount`)
  },
  getList(params){
    return axios.post(`${base.spurl}/ncpr/proCount/page`,params)
  },
  //刷新
  refresh(){
    return axios.post(`${base.spurl}/ncpr/proCount/runTimeTask`)
  },
  getProjOptions(){
    return axios.get(`${base.spurl}/ncpr/monitor/allPro`)
  }
}
// 统一导出
export default loginhome;